//
//  StatusNormalCell.swift
//  WKweiBo
//
//  Created by 阿拉斯加的狗 on 15/12/13.
//  Copyright © 2015年 阿拉斯加的🐶. All rights reserved.
//

import UIKit

class StatusNormalCell: StatusCell {

    //微博视图模型
   override var viewModel: StatusViewModel? {
        
        didSet{
            
            pictureView.snp_updateConstraints { (make) -> Void in
                
                //根据图片添加视图效果
                let offset = viewModel?.thumbnailUrls?.count > 0 ? StatusCellMargin : 0
                
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
                
                
            }
            
        }
        
    }
    
    
    //更新UI控件
    override func setUpUI() {
        super.setUpUI()
        
        //自动布局
        //配图自动布局
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(StatusCellMargin)
            make.left.equalTo(contentLabel.snp_left)
            make.width.equalTo(300)
            make.height.equalTo(90)
        }
    }

}
